public class Text {
    public static void main(String[] args) {
        E e1 = E.CAT;
        E e2 = E.DOG;

        e1.go();
        e2.go();
    }
}
enum E {
    CAT("小猫"){
        @Override
        public void go() {
            System.out.println(getName()+"优雅地走");
        }
    },DOG("傻狗"){
        @Override
        public void go() {
            System.out.println(getName()+"狂跑");
        }
    };

    private String name;
    public abstract void go();

    E(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}